from rest_framework import serializers

from CalendarApp.models import Tasks, Userparams, User_Task
from CalendarApp.models import Colors
from CalendarApp.models import Types
from django.contrib.auth.models import User


class UsersSerializer(serializers.ModelSerializer):
    class Meta:
        model = User
        fields = ["pk", "username", "password", "is_staff", 'email']


class TasksSerializer(serializers.ModelSerializer):
    class Meta:
        model = Tasks
        fields = ["pk", "tname", "descr", "datet", "color", "type", "timet", "reminder"]


class ColorsSerializer(serializers.ModelSerializer):
    class Meta:
        model = Colors
        fields = ["pk", "color"]


class TypesSerializer(serializers.ModelSerializer):
    class Meta:
        model = Types
        fields = ["pk", "type"]


class UserparamsSerializer(serializers.ModelSerializer):
    class Meta:
        model = Userparams
        fields = ["pk", "telegr", "user"]


class UserTaskSerializer(serializers.ModelSerializer):
    class Meta:
        model = User_Task
        fields = ["pk", "task", "user"]
